package com.lyx.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lyx.common.vo.R;
import com.lyx.server.dao.SignLogDao;
import com.lyx.server.entity.SignLog;
import com.lyx.server.service.SignLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * --- Be Humble and Hungry ---
 *
 * @author McMeloxD
 * @date 2024/8/15
 * @desc
 */
@Service("signLogService")
public class SignLogServiceImpl implements SignLogService {
    @Resource
    private SignLogDao dao;

    /*
    * 根据uid查询签到记录
    * */
    @Override
    public R queryByUid(Integer uid) {
        return R.ok(dao.selectList(new LambdaQueryWrapper<SignLog>().eq(SignLog::getUid,uid).orderByDesc(SignLog::getSTime)));
    }
}
